import config from './config.js'
export default {
	data(){
		return {
			tarDegree: 0,
			tarHeight: 200,
			cos: config.cos,
			initLoad: true,
			pagingLoad: 'more',
			p_name: config.p_name,
			b_name: config.b_name
		}
	},
	onPageScroll(e) {
		if (this.tarHeight > e.scrollTop){
			this.tarDegree = e.scrollTop/this.tarHeight
			if (e.scrollTop/this.tarHeight > .5 && this.color){
				if (this.color.index===null || this.color.index===1){
					this.color.data.reverse()
					this.color.index = 0
				}
			}
			if (e.scrollTop/this.tarHeight < .5 && this.color && this.color.index===0){
				this.color.data.reverse()
				this.color.index = 1
			}
		}else {
			this.tarDegree = 1
		}
	}
}